package com.ihr360.expr.function.excel;


import com.ihr360.expr.ExprDouble;
import com.ihr360.expr.ExprException;
import com.ihr360.expr.context.IEvaluationContext;
import com.ihr360.expr.core.AbstractFunction;
import com.ihr360.expr.core.Expr;
import com.ihr360.expr.utils.ExcelDate;

import java.util.Calendar;

public class TODAY extends AbstractFunction
{
    @Override
    public Expr evaluate(IEvaluationContext context, Expr[] args) throws ExprException {
        assertArgCount(args, 0);
        return new ExprDouble(ExcelDate.toExcelDate(Calendar.getInstance().getTime().getTime()));
    }

    @Override
    public boolean isVolatile() {
        return true;
    }
}
